.TH E1432_SET_INTERRUPT_MASK 3 E1432
.SH NAME
.nf
e1432_set_interrupt_mask \- Set interrupt mask
e1432_get_interrupt_mask \- Get current interrupt mask
.fi
.IX e1432_set_interrupt_mask(3) 3
.IX e1432_get_interrupt_mask(3) 3
.SH SYNOPSIS
.cS
SHORTSIZ16 e1432_set_interrupt_mask(E1432ID hw, SHORTSIZ16 ID,
                                    SHORTSIZ16 mask)
SHORTSIZ16 e1432_get_interrupt_mask(E1432ID hw, SHORTSIZ16 ID,
                                    SHORTSIZ16 *mask)
.cE
.SH DESCRIPTION

\fIe1432_set_interrupt_mask\fR sets the interrupt mask, of a single
channel or group of channels \fIID\fR, to the value given in
\fImask\fR.

\fIe1432_get_interrupt_mask\fR returns the current value of the
interrupt mask, of a single channel or group of channels \fIID\fR,
into a memory location pointed to by \fImask\fR.

This parameter is a "global" parameter.  It applies to an entire E1432
module rather than to one of its channels.  The \fIID\fR parameter is
used only to identify which module the function applies to, and all
channels in that module will report the same value for this parameter.

\fIhw\fR must be the result of a successful call to
\fIe1432_assign_channel_numbers\fR, and specifies the group of
hardware to talk to.

\fIID\fR is either the ID of a group of channels that was obtained
with a call to \fIe1432_create_channel_group\fR, or the ID of a single
channel.

\fImask\fR specifies the mask of events on which to interrupt.  This
parameter may also be set with \fIe1432_set_interrupt\fR.  This mask
is created by ORing together the various conditions defined in the
following table (this table is also found on the \fIe1432_intr(5)\fR
manual page).

.ne 13
.TS
box center;
c s
c | c
l | l.
Interrupt Mask Bit Definitions
_
Define (in e1432.h)	Description
=
E1432_IRQ_BLOCK_READY	Scan of data ready in FIFO
E1432_IRQ_MEAS_ERROR	FIFO overflow or tach buffer overflow
E1432_IRQ_MEAS_STATE_CHANGE	Measurement state machine changed state
E1432_IRQ_MEAS_WARNING	Measurement warning
E1432_IRQ_OVERLOAD_CHANGE	Overload status changed
E1432_IRQ_SRC_STATUS	Source channel interrupt
E1432_IRQ_TACHS_AVAIL	Raw tach times ready for transfer to other modules
E1432_IRQ_TRIGGER	Trigger ready for transfer to other modules
.TE

The \fBE1432_IRQ_SRC_STATUS\fR interrupt is used for source channel
overload, overread, underrun, and shutdown.  When the source is in 
arb data mode, this interrupt is also used for the "ready for arb data"
interrupt.

The \fBE1432_IRQ_MEAS_ERROR\fR currently is used only for a FIFO
overflow.  This normally can happen only when the module is in
continuous mode (see \fIe1432_set_data_mode\fR).  This will interrupt
as soon as the FIFO overflows, but note that the FIFO still has useful
data in it which can still be read by the \fIe1432_read_xxx_data\fR
functions.  \fIe1432_block_available\fR will not indicate that a FIFO
overflow has occurred until all of the remaining data is read out of
the FIFO.  This bit is also used to indicate a raw tach buffer
overflow, which is indicated by the \fBE1432_STATUS2_TACH_OVERFLOW\fR
bit being set in the status register.

A second \fBE1432_IRQ_MEAS_ERROR\fR interrupt will happen after all
data has been read out of a FIFO that previously overflowed.  This can
be used to tell an application that no more data will be available, so
the application can stop the measurement.  For this second
\fBE1432_IRQ_MEAS_ERROR\fR interrupt, the \fBE1432_IRQ_STATUS2_REG\fR
will have the \fBE1432_STATUS2_FIFO_EMPTIED\fR bit set in it.

Once the mask has been set, and an interrupt occurs, the cause of the
interrupt is obtained by reading the \fBE1432_IRQ_STATUS2_REG\fR
register.  The bit position of the interrupt mask and status registers
match so the defines can be used to set and check IRQ bits.  The
\fBE1432_IRQ_STATUS2_REG\fR may have bits set for things that are not
enabled to interrupt using this \fIe1432_set_interrupt_mask\fR
function, so the register value should be binary-ANDed with the mask
setting if you must determine exactly what caused the interrupt.

Once an interrupt occurs, the module will not interrupt again until
\fIe1432_reenable_interrupt()\fR is called.
.SH "RESET VALUE"
After a reset, \fImask\fR is set to \fB0\fR (all causes disabled).
.SH "RETURN VALUE"
Return 0 if successful, a (negative) error number otherwise.
.SH "SEE ALSO"
.na
e1432_block_available, e1432_reenable_interrupt, e1432_set_interrupt,
e1432_check_src_arbrdy, e1432_check_src_shutdown, e1432_check_src_overload,
e1432_check_src_overread, e1432_check_src_underrun, e1432_intr(5),
e1432_get_meas_warning
.ad
